package com.zj.study.utils.beancopier.utils;

/**
 * @author 赵赳
 * @since 2021/9/22 11:59
 */
public class Tuple<T1, T2> {
  private T1 t1;
  private T2 t2;

  public static <T1, T2> Tuple<T1, T2> of(T1 t1, T2 t2) {
    return (new Tuple()).setT1(t1).setT2(t2);
  }

  public Tuple() {
  }

  public T1 getT1() {
    return this.t1;
  }

  public T2 getT2() {
    return this.t2;
  }

  public Tuple<T1, T2> setT1(T1 t1) {
    this.t1 = t1;
    return this;
  }

  public Tuple<T1, T2> setT2(T2 t2) {
    this.t2 = t2;
    return this;
  }

  public boolean equals(Object o) {
    if (o == this) {
      return true;
    } else if (!(o instanceof Tuple)) {
      return false;
    } else {
      Tuple<?, ?> other = (Tuple)o;
      if (!other.canEqual(this)) {
        return false;
      } else {
        Object this$t1 = this.getT1();
        Object other$t1 = other.getT1();
        if (this$t1 == null) {
          if (other$t1 != null) {
            return false;
          }
        } else if (!this$t1.equals(other$t1)) {
          return false;
        }

        Object this$t2 = this.getT2();
        Object other$t2 = other.getT2();
        if (this$t2 == null) {
          if (other$t2 != null) {
            return false;
          }
        } else if (!this$t2.equals(other$t2)) {
          return false;
        }

        return true;
      }
    }
  }

  protected boolean canEqual(Object other) {
    return other instanceof Tuple;
  }

  public int hashCode() {
    boolean PRIME = true;
    int result = 1;
    Object $t1 = this.getT1();
    result = result * 59 + ($t1 == null ? 43 : $t1.hashCode());
    Object $t2 = this.getT2();
    result = result * 59 + ($t2 == null ? 43 : $t2.hashCode());
    return result;
  }

  public String toString() {
    Object var10000 = this.getT1();
    return "Tuple(t1=" + var10000 + ", t2=" + this.getT2() + ")";
  }
}
